<template>
	<div id="center">
		<v-header>
			<div class="headers ">
				<div class="width-1200 my-flex-between">
					<div class="left">
						<span>欢迎来到物流!</span>
						<span class="base-color">请登录</span>
						<span>快速注册</span>
					</div>
					<div class="right">
						<span>订单查询</span>
						<span class="hover">个人中心</span>
						<div class="line"></div>
						<img src="../../assets/wuliu/tel.png" alt="" />
						<span>手机xx</span>
					</div>
				</div>
			</div>
		</v-header>
		<div class="header-place"></div>
		<div class="info-place"></div>
		<div class="center_content">
			<v-centerleft></v-centerleft>
			<div class="right">
				<!--<div class="centertop my-flex-left">
						<div class="usericon" style="position: relative;">
							<img src="../../assets/centers/touxiang.jpg" v-if="!modelData.headImg" />
							<img v-else :src="modelData.headImgUrl" />
							<input class="upfile" type="file" @change="uploadImg($event)" accept="image/*" />
						</div>
						<div class="userinfos">
							<div class="top my-flex-left">
								<span class="companyname">
									<template v-if="modelData.type==1">
										{{modelData.realName}}
									</template>
									<template v-else>
										{{modelData.shortName}}
									</template>
								</span>
								<span class="level my-flex-center">{{modelData.levelCN}}</span>
							</div>
							<div class="">
								<div class="verfication my-flex-center">
									已认证
								</div>
							</div>

						</div>
					</div>-->
				<!--<v-centertop></v-centertop>-->
				<router-view></router-view>

			</div>
		</div>
	</div>
</template>

<script>
	import service from '@/js/common/customerservice.js';
	export default {
		components: {

		},
		data() {
			return {
				modelData: {},
				msgCount: '',
				companyList: [],
				formVisible: false,
				companyId: '',
				isRouterAlive: true,
				currentRoute: ''
			}
		},

		beforeRouteEnter(to, from, next) {
			next((vm) => {
				if(from.fullPath == '/') {

				}

			})
		},
		async mounted() {
			//			this.currentRoute=this.$route.path;
			//			this.getMsgcount();
			//			let arr = ['netstat_antup'];
			//			await this.tool.getDirByKey(this, arr).then(() => {
			//
			//			});
			//			this.getUserInfo();

		},
		methods: {
			...service,
			uploadImg(ev) {
				let that = this;
				let files = ev.target.files;
				for(let file of files) {
					//本地预览
					var oFReader = new FileReader();
					oFReader.readAsDataURL(file);
					oFReader.onload = function(oFREvent) {
						var s = oFREvent.target.result;
						var index = s.indexOf(',')
						var t = s.substring(index + 1, s.length)
						$(ev.target).siblings('img').prop("src", s);
					};
					var filename = file.name
					var AllImgExt = ".jpg|.png|.jpeg|";
					var type = filename.substring(filename.lastIndexOf(".")).toLowerCase();
					var formData = new FormData();
					formData.append('file', file);
					that.httptool.ajaxFilePost('upload', formData, (res) => {
						ev.target.value = null;
						if(res.code == 1) {
							that.modelData.headImg = res.data.id;
							this.editHeadImg();
						}
					});
				}
			},
		}
	}
</script>

<style lang="less" scoped="scoped" src="../../less/page/center/center.less"></style>